<template>
  <view class="flex fs24 agree flex flex-wrap">
    <u-checkbox-group style="width: 180px;display: inline;float: left;">
      <u-checkbox
        activeColor="#1FB0AD"
        :checked="isChecked"
        v-model="isChecked"
        shape="circle"
        @change="checkboxChange"
        label-size="12"
        label-color="#666"
        label="我已阅读并同意懂鲜帝平台的"
      >
        <text class="text-666 fs24" style="font-size: 24rpx!important;">我已阅读并同意懂鲜帝平台的</text>
      </u-checkbox>
    </u-checkbox-group>
    <!-- <text class="text-666">我已阅读并同意懂鲜帝平台的</text> -->
    <text class="text-blue" style="float: left" @click="toUserAgreement('private')">《用户协议》</text>
    <text class="text-666" style="float: left">和</text>
    <text class="text-blue private" style="float: left;" @click="toUserAgreement('policy')">《隐私政策》</text>
  </view>
</template>
<script>
export default {
  props: {
    value: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    isChecked: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', val)
      }
    }

  },
  methods: {
    toUserAgreement(val) {
      uni.navigateTo({
        url: '/sub/pages/my/private/index?type=' + val
      })
    },
    checkboxChange(val) {
      this.isChecked = val
    },
  },
  data() {
    return {
    }
  }
}
</script>
<style scoped lang="scss">
.agree {
  ::after {
    content: "";
    display: table;
    clear: both;
  }
}
.text-blue {
  color: #1fb0ad;
}
</style>